home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility2 / wine02bx.zip / LISP / UTILS / WITH-TIM.ELC < prev   
Text File  |  1993-03-28  |  2KB  |  28 lines

  1. ;;; compiled by jwz@thalidomide on Wed Dec 16 10:05:44 1992
  2. ;;; from file /u/jwz/emacs19/lisp/utils/with-timeout.el
  3. ;;; emacs version 19.4 Lucid.
  4. ;;; bytecomp version 2.08; 27-aug-92.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (fset 'with-timeout-timer #[(tag) "└┴┬Åç" [nil (throw tag nil) ((no-catch))] 3])
  14. (fset 'with-timeout '(macro . #[(seconds-and-timeout-forms &rest body) "@A├─┼╞\n╟╚FDD╔╩╦╠╚═╬╧\"╤EEDC╥╚╬╙    \"╦FE╘EE*ç" [seconds-and-timeout-forms timeout-forms seconds let* (with-timeout-tag (make-symbol "_with_timeout_")) with-timeout-timeout add-timeout 'with-timeout-timer with-timeout-tag unwind-protect let value catch prog1 append (progn) body (setq with-timeout-tag nil) if (progn) (disable-timeout with-timeout-timeout)] 11 "\
  15. Usage: (with-timeout (seconds &rest timeout-forms) &rest body)
  16. This is just like progn, but if the given number of seconds expires before
  17. the body returns, then timeout-forms are evaluated and returned instead.
  18. The body won't be interrupted in the middle of a computation: the check for 
  19. the timer expiration only occurs when body does a redisplay, or prompts the
  20. user for input, or calls accept-process-output."]))
  21. (put 'with-timeout 'lisp-indent-function 1)
  22. (fset 'yes-or-no-p-with-timeout #[(timeout prompt &optional default-value) "└┴!├ ┼\n#╟Ä\n╚ì    \n½ô╩ ╠½â╬¬ü╧Q!ê¬é    ,ç" [make-symbol "_with_timeout_" with-timeout-tag add-timeout timeout with-timeout-timer with-timeout-timeout ((disable-timeout with-timeout-timeout)) (byte-code "└    !┬ç" [yes-or-no-p prompt nil with-timeout-tag] 2) value message prompt "(yes or no) Timeout to " default-value "Yes" "No"] 4 "\
  23. Just like yes-or-no-p, but will time out after TIMEOUT seconds
  24. if the user has not yes answered, returning DEFAULT-VALUE."])
  25. (fset 'y-or-n-p-with-timeout #[(timeout prompt &optional default-value) "└┴!├ ┼\n#╟Ä\n╚ì    \n½ô╩ ╠½â╬¬ü╧Q!ê¬é    ,ç" [make-symbol "_with_timeout_" with-timeout-tag add-timeout timeout with-timeout-timer with-timeout-timeout ((disable-timeout with-timeout-timeout)) (byte-code "└    !┬ç" [y-or-n-p prompt nil with-timeout-tag] 2) value message prompt "(yes or no) Timeout to " default-value "Yes" "No"] 4 "\
  26. Just like y-or-n-p, but will time out after TIMEOUT seconds
  27. if the user has not yes answered, returning DEFAULT-VALUE."])
  28.